/**
 * http://usejsdoc.org/
 * @class cipher与decipher  加解密
 */
var crypto = require('crypto'),
	key = 'salt_from',
	plaintext = 'devintam',
	cipher = crypto.createCipher('aes-256-cbc',key),//获取cipher加密对象
	decipher = crypto.createDecipher('aes-256-cbc',key);//获取decipher加密对象

cipher.update(plaintext,'utf8','hex');
var encryptedPassword = cipher.final('hex');

decipher.update(encryptedPassword,'hex','utf8');
var decryptedPassword = decipher.final('utf8');

console.log('encrypted',encryptedPassword);
console.log('decrypted:',decryptedPassword);